
<section id="mybody">
<div class="container">
<div class="row">





<section id="hide_form" class="_hide">
<form id="form1" name="form1" action="<?=base_url().'index.php/main_control/entrance_do'?>" method="post">
<input type="text"  name="openId" id="openId" placeholder="openId"  value="<?php echo isset($openId)?$openId:'';?>">
<input type="text"  name="name" id="name" placeholder="name" value="<?php echo isset($name)?$name:'';?>">
<input id="uid"  name="uid" placeholder="uid" type="text" class="form-control"  value="<?php echo isset($uid)?$uid:0;?>" >
<input id="creator"  name="creator" placeholder="creator" type="text" class="form-control"  value="<?php echo isset($creator)?$creator:0;?>" >
<input id="state"  name="state" placeholder="state" type="text" class="form-control"  value="<?php echo isset($state)?$state:-1;?>" >
<input id="flag"  name="flag" placeholder="flag" type="text" class="form-control"  value="<?php echo isset($flag)?$flag:-1;?>" >

</form>
</section>

<!--  
<section id="mylogo">
<img alt="140x140" class="img-circle img-responsive center-block" data-src="holder.js/140x140" style="width: 140px; height: 140px;" src="" data-holder-rendered="true">
</section>
-->

<?php if ($state==-1): ?>
<section id="mybody_2">
<div class="jumbotron">
<p><h3>赶紧注册经纪人吧 !</h3></p>
<p><h3>丰厚佣金等着您哟 : )</h3></p>
<p><a class="btn btn-warning btn-lg" href="#" role="button" onClick="tijiao(1)" >我要注册</a></p>
</div>
</section>
<?php endif; ?>

<?php if ($state==1): ?>
<section id="mybody_1">
<div class="jumbotron">
<p><h3>赶紧推荐客户吧 !</h3></p>
<p><h3>丰厚佣金等着您哟 : )</h3></p>
<p><a class="btn btn-warning btn-lg" href="#" role="button" onClick="tijiao(2)" >我要推荐</a></p>
</div>
</section>
<?php endif; ?>



<?php if ($state==0): ?>
<section id="mybody_3">
<div class="jumbotron">
<p><h3>感谢您加入组织</h3></p>
<p><h3>正在加紧审核中...</h3></p>
<p><a class="btn btn-primary btn-lg" href="#" role="button" onclick="WeixinJSBridge.call('closeWindow');" >关闭</a></p>
</div>
</section>
<?php endif; ?>

<?php if ($state==2): ?>
<section id="mybody_3">
<div class="jumbotron">
<p><h3>您的账号已经暂停</h3></p>
<p><a class="btn btn-primary btn-lg" href="#" role="button" onclick="WeixinJSBridge.call('closeWindow');" >关闭</a></p>
</div>
</section>
<?php endif; ?>




<script>
/* 缓存 */
$(window).load(function() { 
	var openId = document.getElementById("openId"); 
	var uid = document.getElementById("uid");
	var creator = document.getElementById("creator"); 
	var name = document.getElementById("name"); 
	var state = document.getElementById("state"); 
	var flag = document.getElementById("flag");
	
	if(flag.value==-1){	//入口登陆时 将以下字段存入缓存
		sessionStorage.setItem("openId", openId.value); 
		sessionStorage.setItem("name", name.value);
		sessionStorage.setItem("uid", uid.value);
		sessionStorage.setItem("creator", creator.value);
		sessionStorage.setItem("state", state.value);
	}
	$('#uid').val(sessionStorage.getItem("creator"));
// 	var msg = sessionStorage.getItem("state"); 
});

function tijiao(flag){
	$('#flag').val(flag);
// 	alert('flag='+$('#flag').val());
// 	if(flag>0)
    document.form1.submit();
}

</script> 

</section>




